﻿
// ProjectAADlg.h: 头文件
//

#pragma once
#include"LogDlg.h"
#include "ChangeProjectDlg.h"
#include "IODlg.h"
#include "ControlDlg.h"
#include "RS232Dlg.h"
#include "LoginDlg.h"
#include "UserCheckDlg.h"
#include "TcpipDlg.h"
#include "set_sn_dlg.h"

// CProjectAADlg 对话框
class CProjectAADlg : public CDialogEx
{
// 构造
public:
	CProjectAADlg(CWnd* pParent = nullptr);	// 标准构造函数

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_PROJECTAA_DIALOG };
#endif

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持


// 实现
protected:
	HICON m_hIcon;
	CMenu m_menu;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	POINT Old;

	CLogDlg*   m_cLogDlg = nullptr;
	CChangeProjectDlg*  m_cProjectDlg = nullptr;
	CIODlg*  m_cIODlg = nullptr;
	CControlDlg*  m_cControlDlg = nullptr;
	CRS232Dlg*  m_cRS232Dlg = nullptr;
	CLoginDlg*  m_cLoginDlg = nullptr;
	CUserCheckDlg*  m_cUserCheckDlg = nullptr;
	CTcpipDlg*  m_cTcpipDlg = nullptr;
	CSetSnDlg* m_cSetSnDlg = nullptr;

	CBitmap Bitmap;
	HBITMAP hBitmap; 
	HBRUSH hbr;//画笔相关

	LRESULT OnReceiveServerMsg(WPARAM wParam, LPARAM lParam);
	CRect m_rcUiRect;
	CRect OriRect[200];
	int RectW[200] = { 0 };
	int RectH[200] = { 0 };
	void Repaint(CWnd * pWnd, int last_Width, int now_Width, int last_Height, int now_Height, int cnt);
	void SetUiHandle();

	afx_msg void OnOpenLogDlg();
	afx_msg void OnOpenMotorDlg();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnOpenTcpipDlg();
	virtual void OnCancel();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnOpenProjectDlg();
	afx_msg void OnOpenIODlg();
	afx_msg void OnOpenControlDlg();
	afx_msg void OnOpenRS232Dlg();
	afx_msg void OnBnClickedCheck10auto2();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnBnClickedButton1();
	afx_msg void OnLoginDlg();
	afx_msg void OnBnClickedButton2();
	afx_msg void OnBnClickedButton4();
	CListCtrl m_listSave;
	afx_msg void OnLvnItemchangedList1(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMCustomdrawList1(NMHDR *pNMHDR, LRESULT *pResult);
	CButton Button1;
	CButton Button2;
	CButton Button3;
	CButton Static1;
	CStatic Static2;
	CStatic Static3;
	CStatic Static4;
	CStatic Static5;
	CStatic Static6;
	CStatic Static7;
	CStatic Static8;
	CStatic Static9;
	CStatic Static10;
	CStatic Static11;
	CStatic Static12;
	CStatic Static13;
	CStatic Static14;
	CStatic Static15;
	afx_msg void OnBnClickedButton5();
	CStatic Static16;
	CStatic Static17;
	CButton Button4;
	afx_msg void OnOpenMesDlg();

	

public:

	CFont	m_editFont;//字体
	CFont	m_editFont1;//字体
	CFont	m_editFont20;//字体
	CFont	m_editFont2;//字体
	CFont	m_editFont3;//字体
	CFont	m_editFont4;//字体

	HANDLE unique_mutex;

	// 初始化窗口的控件数据
	void InitUi();
	afx_msg void OnHandleOpenSetBarcode();
	afx_msg void OnBnClickedCheckEndNoScan();
};
